package com.ymf.weibo.filters;

import java.io.IOException;

import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.filter.Filter;

import com.ymf.weibo.hbase.UsersDAO;

public class PasswordStrengthFilterExample {

	public static void main(String[] args) {
		try {
			HTable t = new HTable(HBaseConfiguration.create(), UsersDAO.TABLE_NAME);
			Scan scan = new Scan();
			scan.addColumn(UsersDAO.INFO_FAM, UsersDAO.PASS_COL);
			scan.addColumn(UsersDAO.INFO_FAM, UsersDAO.NAME_COL);
			scan.addColumn(UsersDAO.INFO_FAM, UsersDAO.EMAIL_COL);
			Filter f = new PasswordStrengthFilter(4);
			scan.setFilter(f);
			ResultScanner rs = t.getScanner(scan);
			for (Result r : rs) {
				System.out.println(r);
			}

		} catch (IOException e) {
			e.printStackTrace();
		}

	}
}
